#ifndef AER_PATH_HPP_
#define AER_PATH_HPP_


#include "../aerDefs.hpp"
#include <string>


namespace aer {

///
/// Improvement : use 'absolute' by default instead of 'canonical'
/// (canonical is the absolute path from the root and not just the
///  working directory)
/// + use a buffer of string shared by all application Path 
///
/// right now, absolute is not implemented
///

class Path
{
  private:
    std::string m_canonical;
    std::string m_canonicalDirectory;//
    U32 m_nameIdx;
    //U32 m_directoryIdx;
 
  public:
    static
    void CleanFilename(std::string &filename);

  public:
    explicit Path(const char *pathname="");
    Path(const Path &path);
    
    void changeDirectory(const char *path);
    
    const char* getName() const;
    const char* getDirectory() const;
    const char* getCanonical() const;
    
    bool isDirectory() const;
    bool isFile() const {return !isDirectory();}
};
  
} // aer

#endif //AER_PATH_HPP_
